package org.example.springboot13mybatisgenerator;

import org.example.springboot13mybatisgenerator.bean.Vip;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.example.springboot13mybatisgenerator.repository.VipMapper;
import org.springframework.context.ConfigurableApplicationContext;

@MapperScan(basePackages = "org.example.springboot13mybatisgenerator.repository")
@SpringBootApplication
public class Springboot13MybatisGeneratorApplication {

	@Autowired
	private static VipMapper vipMapper;
	public static void main(String[] args) {
		ConfigurableApplicationContext context = SpringApplication.run(Springboot13MybatisGeneratorApplication.class, args);
//		VipMapper mapper = context.getBean(VipMapper.class);
//		mapper.insert(new Vip(null,"456","789","1900-1-1"));
//		context.close();
		vipMapper.insert(new Vip(null,"456","789","123"));
	}

}
